package com.g3d.objects;

import com.g3d.types.G3DColor;
import com.g3d.types.G3DVector3;

public class G3DLight 
{

	public enum G3DENUM_LIGHT_TYPE
	{
		LIGHT_DIRECTIONAL(0),
		LIGHT_POSITIONAL(1);
		
		private final int _type;
		
		private G3DENUM_LIGHT_TYPE(int type)
		{
			this._type = type;
		}
		
		public int getType()
		{
			return this._type;
		}
	}
	
	private int _lightIndex = 0;
	private boolean _lightEnabled = false;
	private G3DENUM_LIGHT_TYPE _lightType = G3DENUM_LIGHT_TYPE.LIGHT_DIRECTIONAL;
	
	private G3DVector3 _lightPosition = new G3DVector3(0.0f,0.0f,1.0f);
	private G3DVector3 _lightDirection = new G3DVector3(0.0f, 0.0f, -1.0f);
	
	private float _lightSpotExponent = 0.0f;
	private float _lightSpotCutoff = 180.0f;
	
	private float _lightAttenuationX = 1.0f;
	private float _lightAttenuationY = 0.0f;
	private float _lightAttenuationZ = 0.0f;
	
	private G3DColor _ambientColor = new G3DColor(0.4f, 0.4f, 0.4f, 1.0f);
	private G3DColor _diffuseColor = new G3DColor(1.0f, 1.0f, 1.0f, 1.0f);
	private G3DColor _specularColor = new G3DColor(0.0f, 0.0f, 0.0f, 1.0f);
	private G3DColor _emissiveColor = new G3DColor(0.0f, 0.0f, 0.0f, 1.0f);

	public boolean getEnabled()
	{
		return this._lightEnabled;
	}
	public void setEnabled(boolean enabled)
	{
		this._lightEnabled = enabled;
	}
	public int getIndex()
	{
		return this._lightIndex;
	}
	
	public G3DENUM_LIGHT_TYPE getType()
	{
		return this._lightType;
	}
	public void setType(G3DENUM_LIGHT_TYPE type)
	{
		this._lightType = type;
	}
	
	public G3DVector3 getPosition()
	{
		return this._lightPosition;
	}
	public void setPosition(G3DVector3 position)
	{
		this._lightPosition = position;
	}
	
	public G3DVector3 getDirection()
	{
		return this._lightDirection;
	}
	public void setDirection(G3DVector3 direction)
	{
		this._lightDirection = direction;
	}
	
	public float getSpotExponent()
	{
		return this._lightSpotExponent;
	}
	public void setSpotExponent(float value)
	{
		this._lightSpotExponent = value;
	}
	
	public float getSpotCutoff()
	{
		return this._lightSpotCutoff;
	}
	public void setSpotCutoff(float value)
	{
		this._lightSpotCutoff = value;
	}
	
	public float getAttenuationX()
	{
		return this._lightAttenuationX;
	}
	public void setAttenuationX(float value)
	{
		this._lightAttenuationX = value;
	}
	
	public float getAttenuationY()
	{
		return this._lightAttenuationY;
	}
	public void setAttenuationY(float value)
	{
		this._lightAttenuationY = value;
	}
	
	public float getAttenuationZ()
	{
		return this._lightAttenuationZ;
	}
	public void setAttenuationZ(float value)
	{
		this._lightAttenuationZ = value;
	}
	
	public G3DColor getAmbientColor()
	{
		return this._ambientColor.clone();
	}
	public void setAmbientColor(G3DColor color)
	{
		this._ambientColor = color.clone();
	}

	public G3DColor getDiffuseColor()
	{
		return this._diffuseColor.clone();
	}
	public void setDiffuseColor(G3DColor color)
	{
		this._diffuseColor = color.clone();
	}

	public G3DColor getSpecularColor()
	{
		return this._specularColor.clone();
	}
	public void setSpecularColor(G3DColor color)
	{
		this._specularColor = color.clone();
	}

	public G3DColor getEmissiveColor()
	{
		return this._emissiveColor.clone();
	}
	public void setEmissiveColor(G3DColor color)
	{
		this._emissiveColor = color.clone();
	}

	public G3DLight(int index)
	{
		this._lightIndex = index;
	}
	
}
